$(function() {
	queryAdminTradeList(1);
})
function queryAdminStatData() {
	$.ajax({
		url : path + "/admin/stat/info",
		type : "get",
		dataType : "html",
		success : function(data) {
			$("#admin_list_div").html(data);
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function queryAdminSuggestList(pageNo) {
	var queryData = $("#admin_suggest_choose_form").serialize();

	if (queryData == null || queryData == "") {
		queryData = "pageNo=" + pageNo;
	} else {
		queryData = queryData + "&pageNo=" + pageNo;
	}
	$.ajax({
		url : path + "/admin/suggest/list",
		type : "get",
		dataType : "html",
		data : queryData,
		success : function(data) {
			$("#admin_list_div").html(data);
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function queryAdminNewsList(pageNo) {
	var queryData = $("#admin_news_choose_form").serialize();

	if (queryData == null || queryData == "") {
		queryData = "pageNo=" + pageNo;
	} else {
		queryData = queryData + "&pageNo=" + pageNo;
	}
	$.ajax({
		url : path + "/admin/news/list",
		type : "get",
		dataType : "html",
		data : queryData,
		success : function(data) {
			$("#admin_list_div").html(data);
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function auditNews(id, status) {
	$.ajax({
		url : path + "/admin/news/audit",
		type : "get",
		dataType : "json",
		data : {
			id : id,
			status : status
		},
		success : function(data) {
			if (data.result) {
				layer.msg("操作成功", {
					icon : 1
				});
				queryAdminNewsList(1);
			} else {
				layer.msg(data.message, {
					icon : 2
				});
				;
			}
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function queryAdminAccountList(pageNo) {
	var queryData = $("#admin_account_choose_form").serialize();

	if (queryData == null || queryData == "") {
		queryData = "pageNo=" + pageNo;
	} else {
		queryData = queryData + "&pageNo=" + pageNo;
	}
	$.ajax({
		url : path + "/admin/user/list",
		type : "get",
		dataType : "html",
		data : queryData,
		success : function(data) {
			$("#admin_list_div").html(data);
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function deleteAccountById(userId) {
	$.ajax({
		url : path + "/admin/user/delete/" + userId,
		type : "post",
		dataType : "json",
		success : function(data) {
			if (data.result) {
				layer.msg("删除帐号成功", {
					icon : 1
				});
				queryAdminAccountList(1);
			} else {
				layer.msg(data.message, {
					icon : 2
				});
				;
			}
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function queryAdminActivityList(pageNo) {
	var queryData = $("#admin_activity_choose_form").serialize();

	if (queryData == null || queryData == "") {
		queryData = "pageNo=" + pageNo;
	} else {
		queryData = queryData + "&pageNo=" + pageNo;
	}
	$.ajax({
		url : path + "/admin/activity/list",
		type : "get",
		dataType : "html",
		data : queryData,
		success : function(data) {
			$("#admin_list_div").html(data);
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function deleteActivityById(postId) {
	$.ajax({
		url : path + "/admin/activity/delete/" + postId,
		type : "post",
		dataType : "json",
		success : function(data) {
			if (data.result) {
				layer.msg("删除活动成功", {
					icon : 1
				});
				queryAdminActivityList(1);
			} else {
				layer.msg(data.message, {
					icon : 2
				});
				;
			}
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function queryAdminProjectList(pageNo) {
	var queryData = $("#admin_project_choose_form").serialize();

	if (queryData == null || queryData == "") {
		queryData = "pageNo=" + pageNo;
	} else {
		queryData = queryData + "&pageNo=" + pageNo;
	}
	$.ajax({
		url : path + "/admin/project/list",
		type : "get",
		dataType : "html",
		data : queryData,
		success : function(data) {
			$("#admin_list_div").html(data);
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function deleteProjectById(postId) {
	$.ajax({
		url : path + "/admin/project/delete/" + postId,
		type : "post",
		dataType : "json",
		success : function(data) {
			if (data.result) {
				layer.msg("删除项目成功", {
					icon : 1
				});
				queryAdminProjectList(1);
			} else {
				layer.msg(data.message, {
					icon : 2
				});
				;
			}
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function queryAdminProjectTypeList(pageNo) {

	$.ajax({
		url : path + "/admin/projectType/list",
		type : "get",
		dataType : "html",
		data : {
			pageNo : pageNo
		},
		success : function(data) {
			$("#admin_list_div").html(data);
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function deleteProjectTypeById(projectTypeId) {
	$.ajax({
		url : path + "/admin/projectType/delete/" + projectTypeId,
		type : "post",
		dataType : "json",
		success : function(data) {
			if (data.result) {
				layer.msg("删除项目类型成功", {
					icon : 1
				});
				queryAdminProjectTypeList(1);
			} else {
				layer.msg(data.message, {
					icon : 2
				});
				;
			}
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function queryAdminNavigateList(pageNo) {
	var queryData = $("#admin_navigate_choose_form").serialize();

	if (queryData == null || queryData == "") {
		queryData = "pageNo=" + pageNo;
	} else {
		queryData = queryData + "&pageNo=" + pageNo;
	}
	$.ajax({
		url : path + "/admin/navigate/list",
		type : "get",
		dataType : "html",
		data : queryData,
		success : function(data) {
			$("#admin_list_div").html(data);
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function deleteNavigateById(navigateId) {
	$.ajax({
		url : path + "/admin/navigate/delete/" + navigateId,
		type : "post",
		dataType : "json",
		success : function(data) {
			if (data.result) {
				layer.msg("删除平台导航成功", {
					icon : 1
				});
				queryAdminNavigateList(1);
			} else {
				layer.msg(data.message, {
					icon : 2
				});
				;
			}
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function queryAdminDataList(pageNo) {
	var queryData = $("#admin_data_choose_form").serialize();

	if (queryData == null || queryData == "") {
		queryData = "pageNo=" + pageNo;
	} else {
		queryData = queryData + "&pageNo=" + pageNo;
	}
	$.ajax({
		url : path + "/admin/data/list",
		type : "get",
		dataType : "html",
		data : queryData,
		success : function(data) {
			$("#admin_list_div").html(data);
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function deleteDataById(dataId) {
	$.ajax({
		url : path + "/admin/data/delete/" + dataId,
		type : "post",
		dataType : "json",
		success : function(data) {
			if (data.result) {
				layer.msg("删除数据成功", {
					icon : 1
				});
				queryAdminDataList(1);
			} else {
				layer.msg(data.message, {
					icon : 2
				});
				;
			}
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function queryAdminDiscussList(pageNo) {
	var queryData = $("#admin_discuss_choose_form").serialize();

	if (queryData == null || queryData == "") {
		queryData = "pageNo=" + pageNo;
	} else {
		queryData = queryData + "&pageNo=" + pageNo;
	}
	$.ajax({
		url : path + "/admin/discuss/list",
		type : "get",
		dataType : "html",
		data : queryData,
		success : function(data) {
			$("#admin_list_div").html(data);
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function deleteDiscussById(discussId) {
	$.ajax({
		url : path + "/admin/discuss/delete/" + discussId,
		type : "post",
		dataType : "json",
		success : function(data) {
			if (data.result) {
				layer.msg("删除评论成功", {
					icon : 1
				});
				queryAdminDiscussList(1);
			} else {
				layer.msg(data.message, {
					icon : 2
				});
				;
			}
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function queryAdminBannerList(pageNo) {
	$.ajax({
		url : path + "/admin/banner/list",
		type : "get",
		dataType : "html",
		data : {
			pageNo : pageNo
		},
		success : function(data) {
			$("#admin_list_div").html(data);
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function queryAdminSensitiveWordList(pageNo) {
	var queryData = $("#admin_sensitiveWord_choose_form").serialize();

	if (queryData == null || queryData == "") {
		queryData = "pageNo=" + pageNo;
	} else {
		queryData = queryData + "&pageNo=" + pageNo;
	}

	$.ajax({
		url : path + "/admin/sensitiveWord/list",
		type : "get",
		dataType : "html",
		data : queryData,
		success : function(data) {
			$("#admin_list_div").html(data);
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function toUpdateSensitiveWord(wordId) {
	$.ajax({
		url : path + "/admin/sensitiveWord/toUpdate/" + wordId,
		type : "get",
		dataType : "html",
		success : function(data) {
			$("#admin_list_div").html(data);
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function toInsetSensitiveWord() {
	$.ajax({
		url : path + "/admin/sensitiveWord/toInsert",
		type : "get",
		dataType : "html",
		success : function(data) {
			$("#admin_list_div").html(data);
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function deleteSensitiveWordById(wordId) {
	$.ajax({
		url : path + "/admin/sensitiveWord/delete/" + wordId,
		type : "post",
		dataType : "json",
		success : function(data) {
			if (data.result) {
				layer.msg("删除敏感词成功", {
					icon : 1
				});
				queryAdminSensitiveWordList(1);
			} else {
				layer.msg(data.message, {
					icon : 2
				});
				;
			}
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function updateSensitiveWord() {
	$.ajax({
		url : path + "/admin/sensitiveWord/update",
		type : "post",
		data : $("#sensitiveWord_update_form").serialize(),
		dataType : "json",
		success : function(data) {
			if (data.result) {
				layer.msg("修改或新增敏感词成功", {
					icon : 1
				});
				queryAdminSensitiveWordList(1);
			} else {
				layer.msg(data.message, {
					icon : 2
				});
				;
			}
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function checkSensitiveWord() {
	$.ajax({
		url : path + "/admin/sensitiveWord/check",
		type : "post",
		data : $("#sensitiveWord_check_form").serialize(),
		dataType : "json",
		success : function(data) {
			layer.msg(data.message, {
				icon : 2
			});
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function queryAdminQuestionList(pageNo) {
	var queryData = $("#admin_question_choose_form").serialize();

	if (queryData == null || queryData == "") {
		queryData = "pageNo=" + pageNo;
	} else {
		queryData = queryData + "&pageNo=" + pageNo;
	}
	$.ajax({
		url : path + "/admin/question/list",
		type : "get",
		dataType : "html",
		data : queryData,
		success : function(data) {
			$("#admin_list_div").html(data);
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function deleteQuestionById(discussId) {
	$.ajax({
		url : path + "/admin/question/delete/" + discussId,
		type : "post",
		dataType : "json",
		success : function(data) {
			if (data.result) {
				layer.msg("删除问题成功", {
					icon : 1
				});
				queryAdminQuestionList(1);
			} else {
				layer.msg(data.message, {
					icon : 2
				});
				;
			}
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}
function queryAdminTradeList(pageNo) {
	var queryData = $("#admin_trade_choose_form").serialize();

	if (queryData == null || queryData == "") {
		queryData = "pageNo=" + pageNo;
	} else {
		queryData = queryData + "&pageNo=" + pageNo;
	}
	$.ajax({
		url : path + "/admin/trade/list",
		type : "get",
		dataType : "html",
		data : queryData,
		success : function(data) {
			$("#admin_list_div").html(data);
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function deleteTradeById(discussId) {
	$.ajax({
		url : path + "/admin/trade/delete/" + discussId,
		type : "post",
		dataType : "json",
		success : function(data) {
			if (data.result) {
				layer.msg("删除交易记录成功", {
					icon : 1
				});
				queryAdminTradeList(1);
			} else {
				layer.msg(data.message, {
					icon : 2
				});
				;
			}
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}
function queryAdminAnalyzeList(pageNo) {
	var queryData = $("#admin_analyze_choose_form").serialize();

	if (queryData == null || queryData == "") {
		queryData = "pageNo=" + pageNo;
	} else {
		queryData = queryData + "&pageNo=" + pageNo;
	}
	$.ajax({
		url : path + "/admin/analyze/list",
		type : "get",
		dataType : "html",
		data : queryData,
		success : function(data) {
			$("#admin_list_div").html(data);
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function deleteAnalyzeById(analyzeId) {
	$.ajax({
		url : path + "/admin/analyze/delete/" + analyzeId,
		type : "post",
		dataType : "json",
		success : function(data) {
			if (data.result) {
				layer.msg("删除拆解成功", {
					icon : 1
				});
				queryAdminAnalyzeList(1);
			} else {
				layer.msg(data.message, {
					icon : 2
				});
				;
			}
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function queryAdminPlatformDataList(pageNo) {

	var queryData = $("#admin_platform_data_choose_form").serialize();

	if (queryData == null || queryData == "") {
		queryData = "pageNo=" + pageNo;
	} else {
		queryData = queryData + "&pageNo=" + pageNo;
	}

	$.ajax({
		url : path + "/admin/dataPlatform/list",
		type : "get",
		dataType : "html",
		data : queryData,
		success : function(data) {
			$("#admin_list_div").html(data);
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function deletePlatformDataById(platformId) {
	$.ajax({
		url : path + "/admin/dataPlatform/delete/" + platformId,
		type : "post",
		dataType : "json",
		success : function(data) {
			if (data.result) {
				layer.msg("删除成功", {
					icon : 1
				});
				queryAdminPlatformDataList(1);
			} else {
				layer.msg(data.message, {
					icon : 2
				});
				;
			}
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function platformDataAudit(platformId, auditStatus) {
	$.ajax({
		url : path + "/admin/dataPlatform/audit?platformId=" + platformId + "&auditStatus=" + auditStatus,
		type : "post",
		dataType : "json",
		success : function(data) {
			if (data.result) {
				layer.msg("审核成功", {
					icon : 1
				});
				queryAdminPlatformDataList(1);
			} else {
				layer.msg(data.message, {
					icon : 2
				});
				;
			}
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function queryAdminTradeByPlatformId(platformId) {
	$.ajax({
		url : path + "/admin/platformTrade/list",
		type : "get",
		dataType : "html",
		data : {
			pageNo : 1,
			platformId : platformId
		},
		success : function(data) {
			$("#admin_list_div").html(data);
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function queryAdminPlatformTradeList(pageNo) {

	var queryData = $("#admin_platform_trade_choose_form").serialize();

	if (queryData == null || queryData == "") {
		queryData = "pageNo=" + pageNo;
	} else {
		queryData = queryData + "&pageNo=" + pageNo;
	}

	$.ajax({
		url : path + "/admin/platformTrade/list",
		type : "get",
		dataType : "html",
		data : queryData,
		success : function(data) {
			$("#admin_list_div").html(data);
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function deletePlatformTradeById(platformTradeId) {
	$.ajax({
		url : path + "/admin/platformTrade/delete/" + platformTradeId,
		type : "post",
		dataType : "json",
		success : function(data) {
			if (data.result) {
				layer.msg("删除成功", {
					icon : 1
				});
				queryAdminPlatformTradeList(1);
			} else {
				layer.msg(data.message, {
					icon : 2
				});
				;
			}
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}

function platformTradeAudit(platformTradeId, auditStatus) {
	$.ajax({
		url : path + "/admin/platformTrade/audit?platformTradeId=" + platformTradeId + "&auditStatus=" + auditStatus,
		type : "post",
		dataType : "json",
		success : function(data) {
			if (data.result) {
				layer.msg("审核成功", {
					icon : 1
				});
				queryAdminPlatformTradeList(1);
			} else {
				layer.msg(data.message, {
					icon : 2
				});
				;
			}
		},
		error : function() {
			layer.msg("服务器网络繁忙", {
				icon : 2
			});
		}
	});
}